package com.ttjj.enums;

public class EnumBlockStrType {
    public static final String Ground = "G";
    public static final String Mud = "M";
    public static final String Rock = "R";
    public static final String Tree = "T";
    public static final String Waste = "W";
    public static final String FarmHouse = "FH";
    public static final String ChickenHouse = "CH";
    public static final String RabbitHouse = "RH";
    public static final String PigHouse = "PH";
    public static final String CattleHouse = "OH";

    public EnumBlockStrType() {
    }

    public static String convertFrom(EnumBlockType blockType) {
        switch (blockType.ordinal()) {
            case 1:
                return "G";
            case 2:
                return "M";
            case 3:
                return "R";
            case 4:
                return "T";
            case 5:
                return "W";
            case 6:
                return "FH";
            case 7:
                return "CH";
            case 8:
                return "RH";
            case 9:
                return "PH";
            case 10:
                return "OH";
            default:
                return "G";
        }
    }

    public static EnumBlockType convertTo(String blockStrType) {
        switch (blockStrType) {
            case "G":
                return EnumBlockType.Ground;
            case "M":
                return EnumBlockType.Mud;
            case "R":
                return EnumBlockType.Rock;
            case "T":
                return EnumBlockType.Tree;
            case "W":
                return EnumBlockType.Waste;
            case "FH":
                return EnumBlockType.FarmHouse;
            case "CH":
                return EnumBlockType.ChickenHouse;
            case "RH":
                return EnumBlockType.RabbitHouse;
            case "PH":
                return EnumBlockType.PigHouse;
            case "OH":
                return EnumBlockType.CattleHouse;
            default:
                return EnumBlockType.Ground;
        }
    }
}
